package com.zr.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletResponseAware;
import org.springframework.stereotype.Controller;

import com.zr.service.InsertStationService;
/**
 * 
 * @author Administrator lxg
 *
 */
@Controller
public class InsertStationAction implements ServletResponseAware{
	private HttpServletResponse resp;
	private int disid1;
	private int disid2;
	
	public int getDisid1() {
		return disid1;
	}

	public void setDisid1(int disid1) {
		this.disid1 = disid1;
	}

	public int getDisid2() {
		return disid2;
	}

	public void setDisid2(int disid2) {
		this.disid2 = disid2;
	}

	@Override
	public void setServletResponse(HttpServletResponse arg0) {
		// TODO Auto-generated method stub
		this.resp=arg0;
	}
	@Resource
	private InsertStationService instseim;
	
	public void insertStation(){
		resp.setCharacterEncoding("utf8");		
		try {
			PrintWriter pw=resp.getWriter();			
			instseim.insertStation1(disid1, disid2);			
			pw.write("1");
			pw.flush();
			pw.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
